﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GalaxyDefenderChaos
{
    public class Rocket : CModel
    {
        CModel _owner;

        CModel _target;

        public CModel Target
        {
            get { return _target; }
            set { _target = value; }
        }

        public CModel Owner
        {
            get { return _owner; }
            set { _owner = value; }
        }

        double timeLife;

        public double TimeLife
        {
            get { return timeLife; }
            set { timeLife = value; }
        }

        public Rocket(Model model, Vector3 Position, Vector3 Rotation,
             Vector3 Scale, GraphicsDevice graphicsDevice, CModel owner, CModel target) : base( model,  Position,  Rotation,
              Scale,  graphicsDevice)
        {
            _owner = owner;
            _target = target;
            timeLife = 3000;
            Speed = 9;
        }

        public override void Update(GameTime gameTime, Microsoft.Xna.Framework.Input.Touch.TouchCollection touchCollection)
        {
            timeLife -= gameTime.ElapsedGameTime.TotalMilliseconds;
            
            base.Update(gameTime, touchCollection);
        }
    }
}
